
<?php 
	//echo anchor("frontcontroller/contactus" , "Contact us | ");
	//echo anchor("frontcontroller/aboutus" , "About us | "); 
	//echo anchor("admin/admin" , "Dashboard | ");
?>

		<!-- Slide -->
		
		<!-- Slide -->
        <!-- Page Title -->
		
        
		<div class="container">
			<div class="row clearfix">
						<div class="col-md-3 column">
							<div class="row">
								<div class="col-md-12 sidebar">
									<div class="side-title"><h3>Recent posts:</h3></div>
									<div class="thumbnail">
										<img alt="300x200" src="http://lorempixel.com/600/200/sports" />
										<div class="caption">
											<h3>
												Thumbnail label
											</h3>
											<p>
												Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
											
												<a href="#">Read more</a> 
											</p>
										</div>
									</div>
									
	
									<div class="thumbnail">
										<img alt="300x200" src="http://lorempixel.com/600/200/sports" />
										<div class="caption">
											<h3>
												Thumbnail label
											</h3>
											<p>
												Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
											</p>
											<p>
												<a href="#">Read more</a> 
											</p>
										</div>
									</div>
								</div>
								
								<div class="col-md-12 sidebar">
									<div class="side-title"><h3>Recent posts:</h3></div>
									<div class="thumbnail">
										<img alt="300x200" src="http://lorempixel.com/600/200/sports" />
										<div class="caption">
											<h3>
												Thumbnail label
											</h3>
											<p>
												Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
											</p>
											<p>
												<a href="#">Read more</a> 
											</p>
										</div>
									</div>
								</div>
							</div>
						</div>
				
				<div class="col-md-6 column">
					
					<div class="col-md-12" id="posts">
						<div class="blog-post">
							<iframe width="530" height="315" src="//www.youtube.com/embed/WpRaGxIVOH4" frameborder="0" allowfullscreen></iframe>
							<object width="560" height="315">
 <param name="movie" value="http://www.youtube.com/p/PlaylistID"></param>
 <param name="allowFullScreen" value="true"></param>
 <param name="allowscriptaccess" value="always"></param>
 <embed src="http://www.youtube.com/p/PlaylistID" width="560" height="315"
 type="application/x-shockwave-flash" allowscriptaccess="always"
 allowfullscreen="true"></embed></object>
						</div>
						
						<div style="border:2px solid #4f8db3"></div>
					</div>
					
					<div class="col-md-12" id="titleMain">
								<h3><a href="#">Article</a></h3>
						
					</div>
					
					
					<div class="col-md-12">
					
						<?php
						foreach ($posts as $val){
						?>
						<div class="blog-post">
							<div class="row service-wrapper-row">
			        			<div class="col-sm-5">
			        				<div class="service-image">
			        					<?php if($val->post_image == ""){
			        					?><img src="<?php echo base_url()?>upload/default.jpg" alt="Color Schemes">
			        					<?php }else{
											echo $val->post_image;;
			        					}?>
			        					
			        				</div>
			        			</div>
			        			<div class="col-sm-7">
			    					<div>
										<a href="singlepost/<?php echo $val->post_id ?>"><h4><?php echo $val->post_title ?></h4></a>
										<h5>By: <?php echo $val->user_name ?></h5>
										<h5>Post Date: <?php echo $val->post_date?></h5>
									</div>
			    				</div>
							</div>
						</div>
						<?php
						}
						?>

						<div class="blog-post">
							<div class="row service-wrapper-row">
			        			<div class="col-sm-5">
			        				<div class="service-image">
			        					<img src="<?php echo base_url()?>front/img/homepage-slider/slide2.png" alt="Color Schemes">
			        				</div>
			        			</div>
			        			<div class="col-sm-7">
			    					<div>
										<h4>Homepage</h4>
										<h5>Services &amp; Pricing</h5>
										<h5>Team &amp; Open Vacancies</h5>
									</div>
			    				</div>
							</div>
						</div>
						
						<div class="blog-post">
							<div class="row service-wrapper-row">
			        			
			        			<div class="col-sm-5">
			        				<div class="service-image">
			        					<img src="<?php echo base_url()?>front/img/homepage-slider/slide2.png" alt="Color Schemes">
			        				</div>
			        			</div>
			        			<div class="col-sm-7">
			    					<div>
										<h4>Homepage</h4>
										<h5>Services &amp; Pricing</h5>
										<h5>Team &amp; Open Vacancies</h5>
									</div>
			    				</div>
			    				
							</div>
						</div>
						
						<div class="blog-post">
							<div class="row service-wrapper-row">
			        			
			        			<div class="col-sm-5">
			        				<div class="service-image">
			        					<img src="<?php echo base_url()?>front/img/homepage-slider/slide2.png" alt="Color Schemes">
			        				</div>
			        			</div>
			        			<div class="col-sm-7">
			    					<div>
										<h4>Homepage</h4>
										<h5>Services &amp; Pricing</h5>
										<h5>Team &amp; Open Vacancies</h5>
									</div>
			    				</div>
			    				
							</div>
						</div>
						
						<div class="blog-post">
							<div class="row service-wrapper-row">
			        			
			        			<div class="col-sm-5">
			        				<div class="service-image">
			        					<img src="<?php echo base_url()?>front/img/homepage-slider/slide2.png" alt="Color Schemes">
			        				</div>
			        			</div>
			        			<div class="col-sm-7">
			    					<div>
										<h4>Homepage</h4>
										<h5>Services &amp; Pricing</h5>
										<h5>Team &amp; Open Vacancies</h5>
									</div>
			    				</div>
			    				
							</div>
						</div>
						
						<div class="blog-post">
							<div class="row service-wrapper-row">
			        			
			        			<div class="col-sm-5">
			        				<div class="service-image">
			        					<img src="<?php echo base_url()?>front/img/homepage-slider/slide2.png" alt="Color Schemes">
			        				</div>
			        			</div>
			        			<div class="col-sm-7">
			    					<div>
										<h4>Homepage</h4>
										<h5>Services &amp; Pricing</h5>
										<h5>Team &amp; Open Vacancies</h5>
									</div>
			    				</div>
			    				
							</div>
						</div>
						
					</div>
					
				
				</div>
				
				<div class="col-md-3 column">
							<div class="row">
								<div class="col-md-12 sidebar">
					
					<div class="col-sm-12 blog-sidebar">
						<h4>Search our Blog</h4>
						<form>
							<div class="input-group">
								<input class="form-control input-md" id="appendedInputButtons" type="text">
								<span class="input-group-btn">
									<button class="btn btn-md" type="button">Search</button>
								</span>
							</div>
						</form>
						<h4>Recent Posts</h4>
						<ul class="recent-posts">
							<li><a href="#">Lorem ipsum dolor sit amet</a></li>
							<li><a href="#">Sed sit amet metus sit</a></li>
							<li><a href="#">Nunc et diam volutpat tellus ultrices</a></li>
							<li><a href="#">Quisque sollicitudin cursus felis</a></li>
						</ul>
						<h4>Categories</h4>
						<ul class="blog-categories">
							<li><a href="#">Lorem ipsum</a></li>
							<li><a href="#">Sed sit amet metus</a></li>
							<li><a href="#">Nunc et diam </a></li>
							<li><a href="#">Quisque</a></li>
						</ul>
						<h4>Archive</h4>
						<ul>
							<li><a href="#">January 2013</a></li>
							<li><a href="#">February 2013</a></li>
							<li><a href="#">March 2013</a></li>
							<li><a href="#">April 2013</a></li>
							<li><a href="#">May 2013</a></li>
						</ul>
					</div>
					
					
					
								</div>
							</div>
				</div>
			</div>
		</div>
		
		
	
        <div id="player">
        </div>
   
   <script type="text/javascript">
   /*
   Copyright 2011 : Simone Gianni <simoneg@apache.org>

   Released under The Apache License 2.0 
   http://www.apache.org/licenses/LICENSE-2.0

   */

   (function() {
       function createPlayer(jqe, video, options) {
           var ifr = $('iframe', jqe);
           if (ifr.length === 0) {
               ifr = $('<iframe scrolling="no">');
               ifr.addClass('player');
           }
           var src = 'http://www.youtube.com/embed/' + video.id;
           if (options.playopts) {
               src += '?';
               for (var k in options.playopts) {
                   src+= k + '=' + options.playopts[k] + '&';
               }  
               src += '_a=b';
           }
           ifr.attr('src', src);
           jqe.append(ifr);  
       }
       
       function createCarousel(jqe, videos, options) {
           var car = $('div.carousel', jqe);
           if (car.length === 0) {
               car = $('<div>');
               car.addClass('carousel');
               jqe.append(car);
               
           }
           $.each(videos, function(i,video) {
               options.thumbnail(car, video, options); 
           });
       }
       
       function createThumbnail(jqe, video, options) {
           var imgurl = video.thumbnails[0].url;
           var img = $('img[src="' + imgurl + '"]');
           if (img.length !== 0) return;
           img = $('<img>');    
           img.addClass('thumbnail');
           jqe.append(img);
           img.attr('src', imgurl);
           img.attr('title', video.title);
           img.click(function() {
               options.player(options.maindiv, video, $.extend(true,{},options,{playopts:{autoplay:1}}));
           });
       }
       
       var defoptions = {
           autoplay: false,
           user: null,
           carousel: createCarousel,
           player: createPlayer,
           thumbnail: createThumbnail,
           loaded: function() {},
           playopts: {
               autoplay: 0,
               egm: 1,
               autohide: 1,
               fs: 1,
               showinfo: 0
           }
       };
       
       
       $.fn.extend({
           youTubeChannel: function(options) {
               var md = $(this);
               md.addClass('youtube');
               md.addClass('youtube-channel');
               var allopts = $.extend(true, {}, defoptions, options);
               allopts.maindiv = md;
               $.getJSON('http://gdata.youtube.com/feeds/users/' + allopts.user + '/uploads?alt=json-in-script&format=5&callback=?', null, function(data) {
                   var feed = data.feed;
                   var videos = [];
                   $.each(feed.entry, function(i, entry) {
                       var video = {
                           title: entry.title.$t,
                           id: entry.id.$t.match('[^/]*$'),
                           thumbnails: entry.media$group.media$thumbnail
                       };
                       videos.push(video);
                   });
                   allopts.allvideos = videos;
                   allopts.carousel(md, videos, allopts);
                   allopts.player(md, videos[0], allopts);
                   allopts.loaded(videos, allopts);
               });
           } 
       });
       
   })();
           
   $(function() {
       $('#player').youTubeChannel({user:'youtube'});
   });
   
</script>
